<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    tr,td{
      border: 1px solid #000;
      padding: 5px;
    }
  </style>
</head>
<body>
  <table>
    <tr>
      <th>id</th>
      <th>账号</th>
      <th>密码</th>
      <th>修改</th>
    </tr>
    <tbody id="box">
<!--       <tr>
        <td></td>
        <td></td>
        <td></td>
        <td><a href="#">删除</a></td>
      </tr> -->

    </tbody>
  </table>
</body>
</html>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script>
  window.onload =function(){
    $.ajax({
      type: "get",
      url: "/userlist",
      data: null,
      dataType: "json",
      success: function (response) {
        console.log( response );
        // jquery渲染页面
        if( response.code==200){
          let str = "";
          for(let item of response.data){
                str += `<tr>
            <td>${item.id}</td>
            <td>${item.username}</td>
            <td>${item.password}</td>
            <td><a href="#">删除</a></td>
          </tr>`;
          }
          $("#box").html( str );
        }
      }
    });
  }
</script>